package com.ek.distmpl.dao.mapper;

import com.ek.distmpl.dao.model.Power;
import com.ek.distmpl.dao.model.PowerExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PowerMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=PowerSqlProvider.class, method="countByExample")
    long countByExample(PowerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @DeleteProvider(type=PowerSqlProvider.class, method="deleteByExample")
    int deleteByExample(PowerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Delete({
        "delete from power",
        "where power_xid = #{powerXid,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String powerXid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Insert({
        "insert into power (power_xid, xname, ",
        "xvalue, power_xstatus)",
        "values (#{powerXid,jdbcType=CHAR}, #{xname,jdbcType=CHAR}, ",
        "#{xvalue,jdbcType=INTEGER}, #{powerXstatus,jdbcType=INTEGER})"
    })
    int insert(Power record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @InsertProvider(type=PowerSqlProvider.class, method="insertSelective")
    int insertSelective(Power record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=PowerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="power_xid", property="powerXid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="xname", property="xname", jdbcType=JdbcType.CHAR),
        @Result(column="xvalue", property="xvalue", jdbcType=JdbcType.INTEGER),
        @Result(column="power_xstatus", property="powerXstatus", jdbcType=JdbcType.INTEGER)
    })
    List<Power> selectByExample(PowerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Select({
        "select",
        "power_xid, xname, xvalue, power_xstatus",
        "from power",
        "where power_xid = #{powerXid,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="power_xid", property="powerXid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="xname", property="xname", jdbcType=JdbcType.CHAR),
        @Result(column="xvalue", property="xvalue", jdbcType=JdbcType.INTEGER),
        @Result(column="power_xstatus", property="powerXstatus", jdbcType=JdbcType.INTEGER)
    })
    Power selectByPrimaryKey(String powerXid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=PowerSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Power record, @Param("example") PowerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=PowerSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Power record, @Param("example") PowerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=PowerSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Power record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table power
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Update({
        "update power",
        "set xname = #{xname,jdbcType=CHAR},",
          "xvalue = #{xvalue,jdbcType=INTEGER},",
          "power_xstatus = #{powerXstatus,jdbcType=INTEGER}",
        "where power_xid = #{powerXid,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Power record);
}